<?php 
include_once $_SERVER["DOCUMENT_ROOT"] . "/functions/bdd/messages/description.php";
include_once $_SERVER["DOCUMENT_ROOT"] . "/functions/bdd/messages/credits.php";
include_once $_SERVER["DOCUMENT_ROOT"] . "/functions/parser/parse.php";

if (isset($_POST['credits'])) {
    header("location: index.php");
    $credits = parse($_POST['credits']);
    set_credits($credits);
} else {
    ?>

    <!DOCTYPE html>
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" >

        <?php include_once($_SERVER['DOCUMENT_ROOT'] . "/chunks/header.php"); ?>

        <body>
            <div id	 = "corps">

                <?php include_once($_SERVER['DOCUMENT_ROOT'] . "/chunks/entete.php"); ?>
                <?php include_once($_SERVER['DOCUMENT_ROOT'] . "/chunks/form_recherche.php"); ?>
                <?php include_once($_SERVER['DOCUMENT_ROOT'] . "/chunks/menu.php"); ?>	

                <div id="presentation">
                    <p>
                        <?php echo get_description() ?>
                    </p>
                </div>

                <hr style="clear: both"/>

                <div class="underline">
                    <h2>Crédits</h2>
                    <form method="POST" action="modif_credits.php">
                        <p>
                            <textarea rows="30" cols="80" name="credits"><?php echo get_credits() ?></textarea><br/>
                            <input type="submit" />
                        </p>
                    </form>
                </div>
                <?php //include_once("footer.php"); ?>
            </div>
        </body>
    </html>
    <?php
}
?>